<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Django数据库,增删改查</title>
    <style>
      .fu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100vh;
      }
      form {
        height: 300px;
        width: 300px;
      }
      form div input {
        width: 180px;
        height: 30px;
      }
      .yi {
        margin-right: 16px;
      }
      .btn {
        margin-top: 50px;
        margin-left: 30px;
        width: 180px;
        height: 50px;
        box-shadow: 0 0 20px #ccc;
      }
    </style>
  </head>
  <body>
    <!-- 增加 -->
    <div class="fu">
      <form action="/books/add" method="post">
        <label><h1>增加数据到数据库</h1></label>
        <div>
          <label class="yi" for="name">书名:</label
          ><input type="text" name="name" id="name" />
        </div>
        <div>
          <label class="yi" for="price">定价:</label
          ><input type="text" name="price" id="price" />
        </div>
        <div>
          <label for="pub">出版社:</label
          ><input type="text" name="pub" id="pub" />
        </div>
        <div>
          <label for="market_price">市场价:</label
          ><input type="text" name="market_price" id="market_price" />
        </div>
        <input class="btn" type="submit" value="添加新书" />
      </form>
    </div>

    <!-- 删除 -->
    <!-- 改动 -->
    <!-- 查询 -->
    <div class="gai_fu">
      <div>
        <label><h1>查询 MvNodel.object</h1></label>
      </div>
      <div>
        <form action="/books/cha" method="post">
          <input class="btn" type="submit" value="查询" name="name_btn" />
        </form>
        <div>{{cha_xun}}</div>
      </div>
    </div>
  </body>
</html>
